\usepackage{listings}
%\input{algo}

\lstdefinelanguage{chanfle}{	    
 	 morecomment=[l]{//},
 	 morecomment=[s]{/*}{*/},
            literate={:=}{{$\gets$}}1
   	    {<-}{{$\gets$}}1
            {<=}{{$\leq$}}1
            {>=}{{$\geq$}}1
            {!=}{{$\neq$}}1
            {=alfa}{{$=_{\alpha}$}}2
            {<alfa}{{$<_{\alpha}$}}2
            {>alfa}{{$>_{\alpha}$}}2
            {=clave}{{$=_{clave}$}}6
            {<clave}{{$<_{clave}$}}6
            {>clave}{{$>_{clave}$}}6
            {/not}{{$\neg$}}1
            {/and}{{$\land$}}2
            {/andThen}{{$\land_L$}}2
            {/or}{{$\lor$}}2
            {/orThen}{{$\lor_L$}}2
            {/imp}{{$\Rightarrow$}}2
            {/impThen}{{$\Rightarrow_L$}}2
            {/conjVacio}{$\VACIO$}1
            {/alpha}{$\alpha$}1
            {/paratodo}{$\forall$}1
            {/alfa}{$\alpha$}1
						{/iinfi}{$\infty$}1
            {->}{$\rightarrow$}2
            {/in}{$\in$}1
            {NULL}{\sc{null}}4,
   keywords={if,then,else,elif,while,fi,wend,true,false,var,case,of,esac,in,out,inout,nuevo,
   		mod,bool,nat},
}
\lstnewenvironment{algoritmo}{}{}

\lstset{
	language=chanfle,
	basicstyle=\small,
	keepspaces=true,
	flexiblecolumns=false,
	basewidth={0.5em,0.45em},
	keywordstyle=\sffamily, %\bfseries,
	tabsize=4
}

\newcommand{\alias}[2]{
		#1@#2
}

\newcommand{\tup}[1]{Tupla$\langle$#1$\rangle$}

\newcommand{\tupla}[1]{
		Tupla$\langle$\\#1\indent$\rangle$
}

\newcommand{\componente}[1]{\indent\indent #1\\}

\newcommand{\talias}[2]{
		\alias{#1}{\tupla{#2}}
}

\newcommand{\card}[1]{\ensuremath{\mid#1\mid}}

%\newcommand{\kword}[1]{{\slshape #1}}
\newcommand{\tab}{ \hspace*{5.mm}}
%\newcommand{\men}{$<$}
%\newcommand{\may}{$>$}
%\newcommand{\componente}[1]{\indent \indent #1, \newline}
%\newcommand{\tipo}[1]{{\scshape #1}}
%\newcommand{\meiobs}{\ensuremath{\leq_{obs}}}
%\newcommand{\maiobs}{\ensuremath{\geq_{obs}}}
%\newcommand{\igobs}(=_obs}

%\newcommand{\paratodo}[2]{\ensuremath{
%	(\forall #1)(
%		\\ \tab \hbox{#2}\\)}}

%\newcommand{\existe}[2]{\ensuremath{
%	(\existe #1)(
%		\\ \tab \hbox{#2}\\)}}

		
\newcommand{\sombrero}[1]{\ensuremath{\widehat{#1}}}
\newcommand{\imperativo}[1]{\lstinline|#1|}
\newcommand{\sombrerito}[1]{\ensuremath{\widehat{#1}}} %solo juego jajaja
\newcommand{\interfaz}[3]{
\imperativo{#1}
\preypost{#2}{#3}
}
